package com.newlink.building.common_base.model.bean

import com.squareup.moshi.Json
import com.newlink.building.common_base.constant.Base_KcpRquestType
import com.newlink.building.common_base.constant.Base_KcpRquestType.TYPE_APPKEY_ADD
import java.io.Serializable

/**
 * Created by xiaodong on 2022/7/25.
 * 后台接口返回值
 * 用于定义返回值的数据结构、类型
 */
data class HttpResult<T>(
    @Json(name = "data") val data: T
) : Base_BaseBean()

// 用户个人信息
data class UserBean(
    @Json(name = "userId") val userId: Int,
    @Json(name = "username") val username: String
)

// 设备信息
data class DeviceBean(
    @Json(name = "deviceName") val deviceName: String,
    @Json(name = "actionUrl") val actionUrl: String,
    @Json(name = "callState") val callState: String,
)

data class FaceInfoBean(
    @Json(name = "baseCode") val baseCode: String,
)

//用户登录授权信息
data class LoginResponseData(
    @Json(name = "access_token") val access_token: String,
    @Json(name = "userId") val userId: Long
) : Serializable

//data class UserInfoResponseData(
//    @Json(name = "access_token") val access_token: String,
//    @Json(name = "userId") val userId: Long
//) : Serializable

//用户详情信息
data class LoginData(
    @Json(name = "password") val password: String,
    @Json(name = "secretkey") val secretkey: String,
    @Json(name = "domain_address") val domain_address: String,
    @Json(name = "phone") val phone: String,
    @Json(name = "serverAddress") val serverAddress: String,
    @Json(name = "mqtt_username") val mqtt_username: String,
    @Json(name = "mqtt_password") val mqtt_password: String,
    @Json(name = "mqtt_address") val mqtt_address: String,
    @Json(name = "username") val username: String,
    @Json(name = "primary") val primary: Boolean
) : Serializable

//fcms服务器地址信息
data class FcmsInfoData(
    @Json(name = "id") val id: Int,
    @Json(name = "url") val url: String,
    @Json(name = "name") val name: String
) : Serializable

//注册信息
data class RegisterData(
    @Json(name = "email") val email: String,
    @Json(name = "phone") val phone: String,
    @Json(name = "password") val password: String,
    @Json(name = "username") val username: String
)

//门禁设备信息
//data class DeviceData(
//    @Json(name = "id") val id: Long,
//    @Json(name = "itemId") val itemId: Long?,
//    @Json(name = "roomId") val roomId: Long?,
//    @Json(name = "devName") val devName: String,
//    @Json(name = "devStatus") val devStatus: Int,
//    @Json(name = "status") val status: String?,
//    @Json(name = "mac") val mac: String,
//    @Json(name = "sip") val sip: String,
//    @Json(name = "doors") val doors: MutableList<DoorData>?,
//    @Json(name = "devType") val devType: Int,
//    @Json(name = "isPublic") val isPublic: Int,
//    @Json(name = "lastTime") val lastTime: String?,
//)

//门锁信息
data class DoorData(
    @Json(name = "id") val id: Long = 0L,
    @Json(name = "mac") val mac: String = "",
    @Json(name = "doorName") val doorName: String = "",
    @Json(name = "doorNo") val doorNo: Int = 0
)

//密钥列表数据
data class SecretKeyListData(
    @Json(name = "total") val total: Int,
    @Json(name = "list") val list: MutableList<SecretKeyData>?
)

//密钥数据
data class SecretKeyAddData(
    @Json(name = "name") val name: String,
    @Json(name = "prjType") val prjType: Int,
    @Json(name = "openNum") val openNum: Int,
    @Json(name = "repeatType") val repeatType: Int,
    @Json(name = "effectTime") val effectTime: MutableList<Int>,
    @Json(name = "period") val period: String,
    @Json(name = "deviceMacs") val deviceMacs: MutableList<String>,
)

//密钥数据
data class SecretKeyData(
    @Json(name = "id") val id: String,
    @Json(name = "name") val name: String?,
    @Json(name = "tmpPwd") val tmpPwd: String?,
    @Json(name = "openNum") val openNum: Int = 0,
    @Json(name = "repeatType") val repeatType: Int = 0,
    @Json(name = "effectTime") val effectTime: MutableList<Int>?,
    @Json(name = "period") val period: String?,
    @Json(name = "createTime") val createTime: String?,
    @Json(name = "devices") val devices: MutableList<SecretKeyDeviceData> = arrayListOf()
)

data class SecretKeyDeviceData(
    @Json(name = "mac") val mac: String?,
    @Json(name = "name") val name: String?,
    @Json(name = "openNum") val openNum: Int = 0
)


data class StatusData(
    @Json(name = "flag") val flag: Boolean
)

data class SecretQRCodeData(
    @Json(name = "model") val model: String,
    @Json(name = "parentDeviceId") val parentDeviceId: String,
    @Json(name = "deviceId") val deviceId: String,
    @Json(name = "code") val code: String,
    @Json(name = "value") val value: String,
    @Json(name = "token") val token: String
)

/**
 * ------------------------------------------我的------------------------------------------------
 */
//默认Data
data class DefaultData(
    @Json(name = "flag") val flag: Boolean,
) : Serializable

//data class IntegerData(
//    @Json(name = "flag") val flag: Boolean,
//) : Serializable

data class CommonData(
    @Json(name = "code") val code: Int,
    @Json(name = "str") val str: String,
) : Serializable

data class ResponseTopData(
    @Json(name = "result") val result: Int,
    @Json(name = "reason") val reason: String,
) : Serializable

//{"name":"zhangsan123","email":"yongqi.li@fanvil.com","area":"","mobile":"","userType":1,
// "userMax":10,"prjType":2,"mqtt":{"url":"tcp://172.16.13.125:1883","username":"1780853680822980610"}
//获取用户详情
data class UserInfoData(
    @Json(name = "picture") var picture: String = "",
    @Json(name = "name") var name: String = "",
    @Json(name = "email") var email: String = "",
    @Json(name = "mobile") var mobile: String = "",
    @Json(name = "appStatus") var appStatus: Int = 0,
    @Json(name = "prjType") var prjType: Int = 0,//1 别墅 2 社区 3 办公
    @Json(name = "readCount") var readCount: Int = 0,
    @Json(name = "userType") var userType: Int = 0,
    @Json(name = "userMax") var userMax: Int = 0,
    @Json(name = "area") var area: String = "",
    @Json(name = "prjId") var prjId: String = "",
    @Json(name = "userCategory") var userCategory: Int = 1,//1:普通FCMSApp用户 2：kit套件App用户 3：物业管理员App用户
    @Json(name = "setPwdFlag") var setPwdFlag: Boolean = false,//是否需要设置验证码
    @Json(name = "freeswitch") var freeswitch: FreeswitchData = FreeswitchData()
) : Serializable {
    companion object {
        private const val serialVersionUID = 1_000_001L
    }
}

data class MqttDataCache(
    var mqtt: MqttData = MqttData()
) : Serializable

data class UserInfoResp(
    @Json(name = "name") var name: String = "",
    @Json(name = "email") var email: String = "",
    @Json(name = "mobile") var mobile: String = "",
    @Json(name = "userType") var userType: Int = 0,
    @Json(name = "appStatus") var appStatus: Int = 0,
) : Serializable {
    companion object {
        private const val serialVersionUID = 1_000_002L
    }
}

data class KcpInfoData(
    @Json(name = "devId") var devId: String = "",
    @Json(name = "destDevId") var destDevId: String = "",
    @Json(name = "serveraddr") var serveraddr: String = "",
    @Json(name = "port") var port: String = "",
    @Json(name = "stunaddr") var stunaddr: String = "",
    @Json(name = "stunport") var stunport: String = "",
    @Json(name = "turnaddr") var turnaddr: String = "",
    @Json(name = "turnport") var turnport: String = "",
    @Json(name = "turnuser") var turnuser: String = "",
    @Json(name = "turnpwd") var turnpwd: String = ""
) : Serializable

//Config相关信息
data class AppConfigData(
    @Json(name = "mqtt") var mqtt: MqttData?,
    @Json(name = "cfg") var cfg: AgoraData?
) : Serializable

//声网信息
data class AgoraData(
    @Json(name = "aid") var aid: Int,
    @Json(name = "appId") var appId: String
) : Serializable

//MQTT信息
data class MqttData(
    @Json(name = "url") var url: String = "",
    @Json(name = "userName") var userName: String = "",
    @Json(name = "password") var password: String = ""//暂无用,密码传Token即可
) : Serializable {
    companion object {
        private const val serialVersionUID = 1_000_003L
    }
}

//Sip账号信息
data class FreeswitchData(
    @Json(name = "url") var url: String = "",
    @Json(name = "port") var port: String = "",
    @Json(name = "sip") var sip: String = "",
    @Json(name = "username") var username: String = "",
    @Json(name = "password") var password: String = "",
    @Json(name = "realm") var realm: String = ""
) : Serializable {
    companion object {
        private const val serialVersionUID = 1_000_005L
    }
}

//获取消息列表
data class MessageListData(
    @Json(name = "total") val total: Int,
    @Json(name = "list") val list: MutableList<MessageListArrayData>,
) : Serializable


data class MessageListArrayData(
    @Json(name = "id") val id: Long,
    @Json(name = "msgId") val msgId: Long,
    @Json(name = "title") var title: String,
    @Json(name = "content") val content: String,
    @Json(name = "readFlag") var readFlag: Int,//0：未读   1：已读
    @Json(name = "type") val type: Long,
    @Json(name = "createTime") val createTime: String,
    @Json(name = "createTimeUnix") val createTimeUnix: Long
) : Serializable

data class OperateCallbackData(
    @Json(name = "result") val result: Int,
    @Json(name = "reason") val reason: Int,
) : Serializable

data class FamilyListData(
    @Json(name = "total") val total: Int,
    @Json(name = "list") val list: MutableList<FamilyManagementListData1>,
) : Serializable

data class FamilyManagementListData1(
//    @Json(name = "uId") val uId: String,
//    @Json(name = "id") val id: Long,
    @Json(name = "id") val id: String = "",
    @Json(name = "name") val name: String = "",
    @Json(name = "aid") val aid: Int = 0,
    @Json(name = "email") val email: String = "",
    @Json(name = "appStatus") val appStatus: Int = 1,//1 未激活 2 已激活 3禁用
    @Json(name = "mobile") val mobile: String = "",
    @Json(name = "qrCode") val qrCode: String = "",
    @Json(name = "qrFlag") val qrFlag: Boolean = false
) : Serializable

//获取家庭成员列表
data class FamilyManagementListData(
    @Json(name = "id") val id: Long,
    @Json(name = "name") val name: String,
    @Json(name = "sip") val sip: String,
    @Json(name = "email") val email: String,
    @Json(name = "appStatus") val appStatus: Int,
    @Json(name = "mobile") val mobile: String,
    @Json(name = "picture") val picture: String,
    @Json(name = "qrCode") val qrCode: String,
    @Json(name = "qrFlag") val qrFlag: Boolean,
    @Json(name = "prjId") val prjId: Long,
    @Json(name = "roomId") val roomId: Long
) : Serializable

//添加家庭成员
data class AddFamilyManagementData(
    @Json(name = "id") val id: String
)

//获取通话设置
data class CallSettingData(
    @Json(name = "picture") val picture: String,
    @Json(name = "name") val name: String,
    @Json(name = "email") val email: String,
    @Json(name = "mobile") val mobile: String,
    @Json(name = "appStatus") val appStatus: Int,
    @Json(name = "prjId") val prjId: Long,
    @Json(name = "password") val password: String,
    @Json(name = "roomId") val roomId: Long,
    @Json(name = "mqtt") val mqtt: MqttData,
    @Json(name = "freeswitch") val freeswitch: FreeswitchData
) : Serializable

data class FlsMessageListData(
    @Json(name = "total") val total: Int,
    @Json(name = "list") val list: MutableList<FlsMessageData>,
) : Serializable

data class FlsMessageData(
    @Json(name = "id") val id: Long,
    @Json(name = "readFlag") val readFlag: Int,
    @Json(name = "title") val title: String,
    @Json(name = "message") val message: String,
    @Json(name = "createTime") val createTime: String,
    @Json(name = "createTimeUnix") val createTimeUnix: Long,
) : Serializable

/**
 * ------------------------------------------记录------------------------------------------------
 */
//获取开门记录列表
data class OpenDoorRecordData(
    @Json(name = "total") val total: Int = 0,
    @Json(name = "list") val list: MutableList<OpenDoorRecordListData>?,
) : Serializable

//data class OpenDoorRecordListData(
//    @Json(name = "id") val id: Long,
//    @Json(name = "mac") val mac: String,
//    @Json(name = "devName") val devName: String,
//    @Json(name = "prjId") val prjId: Long,
//    @Json(name = "prjItemId") val prjItemId: Long,
//    @Json(name = "type") val type: Int,
//    @Json(name = "roomId") val roomId: Long,
//    @Json(name = "extra") val extra: String,
//    @Json(name = "relay") val relay: Int,
//    @Json(name = "result") val result: Int,
//    @Json(name = "reason") val reason: Int,
//    @Json(name = "optName") val optName: String,
//    @Json(name = "optTime") val optTime: String
//)

data class OpenDoorRecordListData(
    @Json(name = "id") val id: Long = 0L,
    @Json(name = "devName") val devName: String = "",
    @Json(name = "mac") val mac: String = "",
    @Json(name = "type") val type: Int = 0,
    @Json(name = "relay") val relay: String = "",
    @Json(name = "result") val result: Int = 0,
    @Json(name = "optTime") val optTime: String = "",
    @Json(name = "fileUrl") val fileUrl: String = ""
) : Serializable

data class AreaData(
    @Json(name = "id") val id: Long = 0L,
    @Json(name = "name") val name: Int = 0,
)

//获取呼叫记录列表
data class CallRecordData(
    @Json(name = "total") val total: Int = 0,
    @Json(name = "list") val list: MutableList<CallRecordListData>?
) : Serializable

data class CallRecordListData(
    @Json(name = "callerNumber") val callerNumber: String = "",
    @Json(name = "answerNumber") val answerNumber: String = "",
    @Json(name = "startStamp") val startStamp: String = "",
    @Json(name = "callerName") val callerName: String = "",
    @Json(name = "answerName") val answerName: String = "",
    @Json(name = "hangupCause") val hangupCause: Int = 0,//挂断原因 0.正常结束通话 1.用户按拒接键 2.开启了DND 3.在黑名单中 4.port busy 5.媒体协商出错
    @Json(name = "duration") val duration: Int = 0,
    @Json(name = "callType") val callType: Int = 0//通话类型 1.音频 2.视频
)

//获取安防记录列表
data class SecurityRecordData(
    @Json(name = "total") val total: Int = 0,
    @Json(name = "list") val list: MutableList<SecurityRecordListData>?
) : Serializable

data class SecurityRecordListData(
    @Json(name = "id") val id: Long = 0L,
    @Json(name = "mac") val mac: String = "",
    @Json(name = "devName") val devName: String = "",
    @Json(name = "sip") val sip: String = "",
    @Json(name = "alarmType") val alarmType: Int = 0,
    @Json(name = "alarmDesc") val alarmDesc: String = "",
    @Json(name = "alarmTime") val alarmTime: String = "",
    @Json(name = "handle") val handle: Int = 0,
    @Json(name = "alarmIndex") val alarmIndex: Int = 0,
    @Json(name = "fileUrl") val fileUrl: String = ""
)

//获取截图记录列表
data class CaptureVideoListData(
    @Json(name = "name") val name: String,
    @Json(name = "status") val status: Int,
    @Json(name = "username") val username: String,
    @Json(name = "Password") val Password: String
)

//删除记录
data class DeleteRecordData(
    @Json(name = "name") val name: String,
    @Json(name = "status") val status: Int,
    @Json(name = "username") val username: String,
    @Json(name = "Password") val Password: String
)

data class AvatarResponse(
    val name: String,
    val platform: String,
    val size: Int,
    val url: String
)

/**
 *
 * @property change_log String  升级日志
 * @property download_file_address String  apk 下载地址
 * @property download_file_md5 String apk MD5
 * @property force_update Boolean 是否强制升级的版本
 * @property version_code String 版本号
 * @constructor
 */
data class VersionBean(

    val forceUpdate: Boolean,
    val versionCode: String,
    val versionName: String,
    val changeLog: String
)

open class Result<T>(
    var data: T
)

open class KcpResult<T>(
    var data: T
) : Base_BaseBean()

//kcp初始化所有参数
data class KcpInfo(
    var devId: String = "",
    var destDevId: String = "",
    var serveraddr: String = "",
    var port: String = "",
    var stunaddr: String = "",
    var stunport: String = "",
    var turnaddr: String = "",
    var turnport: String = "",
    var turnuser: String = "",
    var turnpwd: String = ""
) : Serializable

//sip参数
data class SipInfo(
    @Json(name = "sipAccount") var sipAccount: String = "",
    @Json(name = "sipPort") var sipPort: String = "",
    @Json(name = "sipAddr") var sipAddr: String = "",
    @Json(name = "sipPwd") var sipPwd: String = "",
    @Json(name = "sipRealm") var sipRealm: String = "",
    @Json(name = "sipDisplay") var sipDisplay: String = "",
    @Json(name = "serverType") var serverType: Int = 0
) : Serializable

//获取sip信息请求的参数
data class SipRequest(
    var requestType: String = "",
    var accessToken: String = "",
    var uId: String = "",
    var data: SipRequestBody
)

//获取sip参数的data
data class SipRequestBody(
    var deviceType: Int = 0,
    var deviceName: String = ""
)

//获取设备列表请求参数
data class DeviceListRequest(
    var accessToken: String = "",
//    var uId: String = "",
    var page: Int,
    var limit: Int,
    var devName: String = "",
    var devType: Int?
//    var data: DeviceListRequestBody
)

data class CardListRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "",
    var data: LoadAuthDataRequestBody
)


//获取sip参数的data
data class DeviceListRequestBody(
    var devName: String = "",
    var page: Int = 0,
    var limit: Int = 0
)

//门禁设备信息
data class DeviceListData(
    @Json(name = "total") val total: Int,
    @Json(name = "list") val list: MutableList<DeviceData> = mutableListOf()
)

data class CategoryListData(
    @Json(name = "total") val total: Int,
    @Json(name = "list") val list: MutableList<CategoryItem> = mutableListOf()
)

data class DeviceData(
    @Json(name = "mac") val mac: String,
    @Json(name = "devStatus") var devStatus: Int,
    @Json(name = "devName") val devName: String?,
    @Json(name = "devType") var devType: Int,
    @Json(name = "lastTime") val lastTime: String?,
    @Json(name = "isPublic") val isPublic: Boolean,
    @Json(name = "aid") val aid: Int,
    @Json(name = "lastTimeUnix") val lastTimeUnix: Long,
    @Json(name = "bluetooth") val bluetooth: Boolean,
    @Json(name = "doors") var doors: MutableList<DoorData>?,
    @Json(name = "enableArming") var enableArming: Int,//是否启用布撤防（0不启用，1启动）
    @Json(name = "armingMode") var armingMode: Int,//-1.撤防模式、0.在家模式 1.离家模式、 2.夜间模式
    @Json(name = "cMqttConnected") var cMqttConnected: Boolean
) : Serializable

data class CategoryItem(
    val cid: Int?,
    val name: String?,
    var isSelected: Boolean?,
    val articles: MutableList<CategorySecondItem>? = mutableListOf()
) {
    data class CategorySecondItem(
        val id: Int?,
        val link: String?,
        val title: String?,
        val chapterId: Int?
    )
}

data class OpenDoorLogsRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "doorRecord/list",
    var data: ListRequestBody,
)

data class CallLogsRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "callRecord/list",
    var data: CallRecordRequestBody,
)

data class SecurityLogsRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "securityRecord/list",
    var data: ListRequestBody,
)

data class FamilyListRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "family/list",
    var data: ListRequestBody
)

data class AddFamilyMemberRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "family/add",
    var data: AddFamilyBody
)

data class AddFamilyBody(
    val name: String,
    val email: String = "",
    val qrFlag: Boolean,
    val masterUserId: String = ""
)

data class RemoveFamilyMemberRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "family/delete",
    var data: RemoveFamilyBody
)

data class RemoveFamilyBody(
    var id: String = "",
)

//获取sip参数的data
data class ListRequestBody(
    var page: Int = 0,
    var limit: Int = 0,
    var mac: String = ""
)

//通话记录data
data class CallRecordRequestBody(
    var sip: String = "",
    var page: Int = 0,
    var limit: Int = 0
)

//开门请求参数
data class OpenDoorRequestKcp(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "",
    var data: OpenDoorBody
)

data class OpenDoorRequest(
    var uId: Long,
    var mac: String = "",
    var whichDoor: Int,
    var action: Int
)


data class OpenDoorBody(
    val msgId: String = "app_${System.currentTimeMillis()}",
    val mac: String = "",
    val doors: MutableList<OpenDoorItem>
)

data class OpenDoorItem(
    val index: Int = 0,
    val action: Int = 0
)

//开门状态
data class OpenDoorResult(
    val result: Int = 0,
    val reason: Int = 0
)

data class OpenDoorKcpResult(
    @Json(name = "requestType") var requestType: String,
    @Json(name = "data") var data: OpenDoorKcpBody
) : Serializable {
    data class OpenDoorKcpBody(
        @Json(name = "msgId") var msgId: String,
        @Json(name = "doors") var doors: MutableList<DoorAckBean>
    ) : Serializable {
        data class DoorAckBean(
            @Json(name = "index") var index: Int,
            @Json(name = "result") var result: Int,
            @Json(name = "reason") var reason: Int
        ) : Serializable
    }
}


data class AlarmListData(
    @Json(name = "total") val total: Int,
    @Json(name = "list") val list: MutableList<AlarmNotifyBean1>,
) : Serializable

data class AlarmNotifyBean1(
    val id: Long,
    val mac: String,
    val devName: String,
    val sip: String,
    val alarmType: Int,
    val alarmDesc: String,
    val alarmTime: String,
    val handle: Int,
    val alarmIndex: Int
) : Serializable

//秘钥列表请求
data class SecretKeyListRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "",
    var data: ListRequestBody
)

//秘钥添加请求
data class SecretKeyAddRequest(
    var accessToken: String = "",
    var name: String = "",
    var prjType: Int = 0,
    var openNum: Int = 0,
    var repeatType: Int = 0,
    var effectTime: MutableList<Int> = arrayListOf(),
    var period: String = "",
    var deviceMacs: MutableList<String> = arrayListOf(),
)

//秘钥操作结果
data class SecretKeyResult(
    val flag: Boolean = true
)

data class SecretKeyAddRequestBody(
    @Json(name = "name") val name: String,
    @Json(name = "openNum") val openNum: Int,
    @Json(name = "repeatType") val repeatType: Int,
    @Json(name = "effectTime") val effectTime: MutableList<Int>?,
    @Json(name = "period") val period: String,
    @Json(name = "deviceMacs") val deviceMacs: MutableList<String>
)

//秘钥详情请求
data class SecretKeyInfoRequest(
    var accessToken: String = "",
    val keyId: String = ""
)

data class SecretKeyInfoRequestBody(
    var keyId: String = "",
    var mac: String = ""
)

//秘钥删除请求
data class SecretKeyDeleteRequest(
    var accessToken: String = "",
    var keyIds: MutableList<String>
)

data class UploadFaceDataRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = TYPE_APPKEY_ADD,
    var data: AuthRequestBody
)

data class LoadAuthDataRequestBody(
    var keyType: Int
)


data class LoadFaceListDataRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "appkey/list",
    var data: LoadAuthDataRequestBody
)

data class DeleteFaceDataRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "appkey/delete",
    var data: DeleteFaceDataRequestBody
)

data class DeleteFaceDataRequestBody(
    var keyId: MutableList<String>
)

data class SecretKeyDeleteRequestBody(
    var mac: String,
    var keyId: MutableList<String>
)

//消息列表请求
data class MessageListRequest(
    var accessToken: String = "",
    var page: Int = 0,
    var limit: Int = 0,
)

data class MessageCountRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = Base_KcpRquestType.TYPE_MESSAGE_COUNT
)

//消息已读请求
data class MessageReadRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "",
    var data: MessageReadRequestBody
) : Serializable

data class MessageReadRequestBody(
    var id: String = ""
)

//消息已读操作结果
data class MessageReadResult(
    val msgNum: Int,
    val noticeNum: Int
)

//清除消息请求
data class MessageCleanRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "",
) : Serializable

//1.卡2.密码3.人像
const val AuthKeyTypeUnknown = 0
const val AuthKeyTypeCard = 1
const val AuthKeyTypePassword = 2
const val AuthKeyTypeFace = 3

data class AuthRequestBody(
    var userId: String = "",
    var keyName: String = "",
    var keyInfo: String = "",
    var keyType: Int = AuthKeyTypeUnknown,
    var macs: Array<String> = arrayOf()
)

data class AuthModifyBody(
    var id: String = "",
    var macs: Array<String> = arrayOf()
)

data class AuthResponseBody(
    var id: String = "",
    var keyName: String = "",
    var keyInfo: String = "",
    var keyType: Int = AuthKeyTypeUnknown,
    var macs: MutableList<String> = mutableListOf(),
    var devNames: MutableList<String> = mutableListOf()
) : Serializable

data class AddAuthRequest(
    var accessToken: String = "",
    var uId: String = "",
    var requestType: String = "appkey/add",
    var data: AuthRequestBody
) : Serializable

data class FaceListData(
    @Json(name = "total") val total: Int,
    @Json(name = "list") val list: MutableList<AuthResponseBody>,
) : Serializable

//消息删除操作结果
data class MessageCleanResult(
    val flag: Boolean = true
)

data class UserQrCodeData(
    @Json(name = "qrCode") val qrCode: String,
    @Json(name = "name") val name: String
) : Serializable

data class AvailableAreaData(
    @Json(name = "total") val total: Int = 0,
    @Json(name = "list") val list: MutableList<AreaData>?,
) : Serializable

//套装注册
data class KitRegisterRequest(
    @Json(name = "area") val area: String = "",
    @Json(name = "mobile") val mobile: String = "",
    @Json(name = "email") val email: String = "",
    @Json(name = "code") val code: String = "",
    @Json(name = "devices") val devices: MutableList<KitDeviceData>?
)

data class KitDeviceData(
    @Json(name = "name") val name: String = "",
    @Json(name = "mac") val mac: String = "",
    @Json(name = "type") val type: Int = 1,//1室内机 2门禁
    @Json(name = "doors") val doors: Int = 0
) : Serializable

//请求验证码参数
data class VerifyCodeRequest(
    @Json(name = "area") val area: String = "",
    @Json(name = "mobile") val mobile: String = "",
    @Json(name = "email") val email: String = "",
    @Json(name = "login") val login: Boolean = false,
    @Json(name = "type") val type: Int = 2,//1短信 2邮箱
    @Json(name = "userCategory") val userCategory: Int = 1//userCategory 1:普通FCMSApp用户 2：kit套件App用户 3：物业管理员App用户
)

//注册信息
data class RegisterResultData(
    @Json(name = "access_token") val access_token: String,
    @Json(name = "userId") val userId: String,
    @Json(name = "userCategory") val userCategory: String,
    @Json(name = "pwdSetting") val pwdSetting: String
)

data class KitDeviceEditData(
    @Json(name = "name") val name: String = "",
    @Json(name = "mac") val mac: String = "",
    @Json(name = "type") val type: Int = 1,//1室内机 2门禁
    @Json(name = "doors") val doors: Int = 0
)

//手机号国家码
data class AreaCodeData(
    @Json(name = "id") val id: Int,
    @Json(name = "area") val area: String,
    @Json(name = "code") val code: String,
    @Json(name = "enable") val enable: Int
)

//更新邮箱
data class EmailData(
    @Json(name = "userId") val userId: Long,
    @Json(name = "email") val email: String
)

//隐私政策和用户协议地址
data class PolicyAgreementData(
    @Json(name = "id") val id: Int,
    @Json(name = "policyPath") val policyPath: String,
    @Json(name = "agreementPath") val agreementPath: String
)

//物业管理-项目列表
data class ProjectData(
    @Json(name = "id") val id: String = "",
    @Json(name = "name") val name: String = "",
    @Json(name = "type") val type: Int = 0
) : Serializable

//物业管理-楼栋(单元)
data class UnitData(
    @Json(name = "id") val id: String,
    @Json(name = "name") val name: String,
    @Json(name = "unitNo") val unitNo: Int
) : UnitTabData()

open class UnitTabData(
    var tabName: String = "",
    var isSelected: Boolean = false,
    var type: Int = 0,
    var prjId: String = ""
) : Serializable

//物业管理-房间
data class RoomData(
    @Json(name = "id") val id: String,
    @Json(name = "roomNo") val roomNo: String,
    @Json(name = "roomName") val roomName: String
) : CateGorySecondItem()

open class CateGorySecondItem(var type: Int = 0) : Serializable

//物业管理-房间内用户
data class RoomUserData(
    @Json(name = "id") val id: String,
    @Json(name = "name") val name: String,
    @Json(name = "email") val email: String,
    @Json(name = "mobile") val mobile: String,
    @Json(name = "userType") val userType: Int,
    @Json(name = "userCategory") val userCategory: Int,
    @Json(name = "aid") val aid: Int,
    @Json(name = "prjId") val prjId: String
)

//物业管理-物业管理员
data class PropertyManagerData(
    @Json(name = "id") val id: String,
    @Json(name = "name") val name: String,
    @Json(name = "aid") val aid: Int
) : CateGorySecondItem()

//意见反馈请求
data class FeedbackRequest(
    var deviceType: String = "",
    var description: String = "",
    var contactInfo: String = ""
)

data class RecordMessageReadRequest(
    var prjId: Long?,
    var type: Int,//日志类型:1.开门日志 2.通话日志 3.安防日志
    var logIds: MutableList<Long>?//不传参默认清除改APP用户所有未读日志，传参只清除该条
)

data class RecordMessageReadResult(
    val logOpen: Int,
    val logCall: Int,
    val security: Int
)